depository

command
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

README

How to verify the success of listening to contract events

Build a client

Create a simple command line tool with the following command.

git clone https://github.com/bestchains/bc-explorer.git

cd cmd/client

go build -o client main.go

Start server

cd bc-saas/cmd/depository
go build main.go

./main -profile profile.json -contract depository -dsn 'postgres://bestchains:Passw0rd!@172.22.96.209:5432/bc-saas?sslmode=disable'

More details about the parameters

  • If you want to enable pprof, you can add the flag -enable-pprof
  • If you want to change another depository certifidate image tempalte file, you can add the flag -cert-template-image
  • If you want to change another depository certifidate font, you can add the flag -cert-ttf-font

Call the contract and confirming that the data is written to the database

  1. call bc-saas PutUntrustValue
 curl -X POST \
  localhost:9999/basic/putUntrustValue \
  -H 'content-type: application/json' \
   -d '{
   "value":"eyJuYW1lIjoiYWJjIiwiY29udGVudFR5cGUiOiAianNvbiIsImNvbnRlbnRJRCI6ICJpZCIsInRydXN0ZWRUaW1lc3RhbXAiOiAiMTIzNCIsInBsYXRmb3JtIjogImJlc3RjaGFpbnMifQo="
}'
  1. check db
bc-saas=> select * from "proof-c0zpw_depository_depository";
 index |                   kid                    |  platform  | operator | owner | blockNumber | contentName | contentID | contentType | trustedTimestamp 
-------+------------------------------------------+------------+----------+-------+-------------+-------------+-----------+-------------+------------------
 12    | a2be544f745022161bc1850053fc61e9ad4d0c8a | bestchains | a        | b     | 22          | abc         | id        | id          | 1234
(1 row)

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL