You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The specification for defining VSC token contracts are not final.
28
-
</Aside>
29
-
30
-
An example token contract has been included in [`examples/token/main.go`](https://github.com/vsc-eco/go-contract-template/blob/main/examples/token/main.go) file. You may copy this file into `contract/main.go` to use as a starting point.
31
-
32
-
```sh
33
-
cp examples/token/main.go contract
34
-
```
35
-
36
-
The token contract features mint/burn with supply cap, transfer and change ownership functions. Update the following constants at the top of the file to your desired values:
37
-
38
-
```go title="main.go"
39
-
constMaxSupply = 1000000
40
-
constPrecision = 3
41
-
constSymbol = "TOKEN"
42
-
constCreator = "hive:vaultec.vsc"
43
-
```
44
-
45
-
<Asidetype="note">
46
-
The `Creator` address will be the initial owner of your token contract. You will need to have access to this account to initialize your token and mint new tokens.
Call the `init` function from your token contract owner address as specified in the `Creator` constant. The contract call payload does not matter here.
45
+
Call the `init` function from your token contract owner address (contract deployer if not specified) with the following payload:
This is a guide on setting up a local development testnet (aka devnet) for testing protocol changes or contracts in a live environment. Devnets are short lived in nature and can be reset easily.
10
+
11
+
## Hive testnet
12
+
13
+
This is just a standard [haf_api_node](https://gitlab.syncad.com/hive/haf_api_node) deployment with the exception of using the HAF testnet image.
14
+
15
+
1. Clone the `haf_api_node` repository and make a copy of `.env` file.
# caddy sites (read description in the .env file for info)
36
+
CADDY_SITES="http://"
37
+
```
38
+
39
+
Optionally update `ZPOOL`, `TOP_LEVEL_DATASET` and `ZPOOL_MOUNT_POINT` to your desired directory.
40
+
41
+
3. Create the folders.
42
+
43
+
```sh
44
+
sudo ./create_directories.sh
45
+
```
46
+
47
+
4. Copy the `config.ini` and `pgtune.conf` files from [here](https://github.com/techcoderx/hiverpc-resources/tree/main/testnet) into the dataset folder and `haf_postgresql_conf.d` folder respectively.
48
+
49
+
<Asidetype="note">
50
+
These files include the default settings and key required to get block production working.
51
+
</Aside>
52
+
53
+
Using the default values for example:
54
+
55
+
<FileTree>
56
+
- haf-pool
57
+
- haf-datadir
58
+
- config.ini
59
+
- haf_postgresql_conf.d
60
+
- pgtune.conf
61
+
</FileTree>
62
+
63
+
5. Start the Hive testnet.
64
+
65
+
```sh
66
+
docker compose up -d
67
+
```
68
+
69
+
To reset the Hive testnet, delete the HAF data directory and repeat from step 3 to 5 above.
70
+
71
+
## Magi testnet
72
+
73
+
1. Clone and compile Magi node executables.
74
+
75
+
```sh
76
+
git clone https://github.com/vsc-eco/go-vsc-node
77
+
cd go-vsc-node
78
+
go mod download
79
+
make
80
+
```
81
+
82
+
2. Run the devnet setup script. Run `-help` to view more options.
0 commit comments