Skip to content

Commit

Permalink
implement suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Platinium authored and Platinium committed Aug 6, 2024
1 parent 121a549 commit 7862304
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 46 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The repository needs to have its workflow permissions set to `read and write`, i
- [X] [Introduction.md](./docs/Introduction.md)
- [ ] [core-philosophy.md](./docs/discussions/core-philosophy.md)
- [ ] [dex.md](./docs/discussions/dex.md)
- [X] [FAQ.md](./docs/discussions/FAQ.md)
- [ ] [wrapping.md](./docs/discussions/wrapping.md)
- [X] [generate-wallet.md](./docs/how-to/generate-wallet.md)
- [X] [host-node.mdx](./docs/how-to/host-node.mdx)
Expand All @@ -32,3 +33,8 @@ The repository needs to have its workflow permissions set to `read and write`, i
- [ ] [sdk.md](./docs/references/sdk.md)
- [X] [first-contract.md](./docs/tutorials/first-contract.md)
- [X] [invoke-contract.md](./docs/tutorials/invoke-contract.md)


### Reminders

- when contract deployment supports lite accounts, add to the documentation
4 changes: 4 additions & 0 deletions docs/Introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ One of our main goals is to improve the accessibility of smart contract creation

We have various example contracts/ applications that can be used as inspiration for your development journey. [You can see the full list here](./references/examples.md).

### FAQ

The most frequently asked questions get a spot in our FAQ document. This should be your entrypoint in case you are stuck. [Checkout the document here](./discussions/FAQ.md)

## The architecture

Here we give you an overview of the VSC architecture. This is important to understand the underlying principles of the VSC network.
Expand Down
55 changes: 55 additions & 0 deletions docs/discussions/FAQ.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# FAQ

## Do we supply node snapshots for node operators?

No, you're node should sync up in ~1 day. If it takes significantly longer than that, contact us.

## Are there any node rewards?

Not yet. We have plans of doing a proof of burn model were node operators essentially buy credits to produce blocks. Then, when you produce blocks, you'd get a small reward on top of your initial investment.
Note: We are not guaranteeing any specifics at the moment. This is subject to change as we do addition research.

## When will I be able to deploy my token on VSC?

We do not have a specific timeline for this.
However, we are currently working on token and wrapping technology internally with HIVE, HBD, and BTC. Once all the kinks are ironed out with that, we will define public token standard(s) and create a reference implementation for each of those standard(s).

## How do I run a node?

Checkout [this repository](https://github.com/vsc-eco/vsc-deployment).

## Why do I see Error: No withdrawals to process?

This is typically normal, especially when your node is re-indexing. Most blocks don't generate withdrawals from the multisig, at the moment. In fact, at the time of writing, there should only be 1 withdrawal from vaultec, so you should see this message many times in your logs.

## How do to update a node?

Firstly, be sure to use the deployment from #4 ⁠faqs⁠ and then run sudo docker-compose up -d. This will pull the latest VSC node docker image automatically.

## How to check if a node is up to date?

`sudo docker-compose exec vsc-node cat .git/refs/heads/main`

This will show you the commit you are on.

Then you can compare it the latest commit in the vsc-node [GitHub repo](https://github.com/vsc-eco/vsc-node/commits/main/).

## How do I migrate from the vsc-node repo to the vsc-deployment repo?

1) cd ~/vsc-node (or where ever your vsc-node repo is)
2) sudo docker-compose down
3) sudo ./migrate.sh
4) cd ../vsc-deployment (or where ever you set the new repo to be)
5) sudo docker-compose up -d

## How do I start writing a smart contract on VSC?

This is our contract template. It should be enough to get started. There is usage and suggestions in [this repo](https://github.com/vsc-eco/contract-template) README.

Also, [here is a DEX](https://github.com/vsc-eco/dex) that we are working on that tries to use/showcase best practices for writing VSC contracts.

As for a formal docs site, we don't have that at the moment.

However, you can checkout the AssemblyScript docs for usage of the smart contract language. It is very similar to TypeScript. Then, everything you need to interface with the VSC chain state is available in the @vsc.eco/sdk npm package.

If you have any concrete suggestions about what we should include in a formal documentation site, please let us know.
50 changes: 6 additions & 44 deletions docs/how-to/generate-wallet.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,13 @@
# Generate wallet

VSC on its layer 2 supports _ed25519_ compatible wallets. They can be generated in various ways. Below you have the current recommended options.
VSC on its layer 2 supports _ed25519_ compatible wallets. Those are called lite accounts in the context of VSC. They can be generated in various ways. Below you have the current recommended options.

## Python script
## Official wallet generator

You can run a python script that generates the public/ private key for you. The prerequisites is the pip module _cryptography_ and a local python installation.
The offical recommended way to generate a lite account is via the wallet generator repository.

1. install pip package `pip install cryptography`
It is based on NodeJS and is fairly lightweight.

2. run the script
Clone the repository, install the node modules and run the generator.

```python
from cryptography.hazmat.primitives.asymmetric import ed25519
from cryptography.hazmat.primitives import serialization
import binascii

# Generate a new Ed25519 private key
private_key = ed25519.Ed25519PrivateKey.generate()

# Get the public key
public_key = private_key.public_key()

# Get the raw bytes of the private key
private_bytes = private_key.private_bytes(
encoding=serialization.Encoding.Raw,
format=serialization.PrivateFormat.Raw,
encryption_algorithm=serialization.NoEncryption()
)

# Get the raw bytes of the public key
public_bytes = public_key.public_bytes(
encoding=serialization.Encoding.Raw,
format=serialization.PublicFormat.Raw
)

# Convert to hexadecimal
private_hex = binascii.hexlify(private_bytes).decode('ascii')
public_hex = binascii.hexlify(public_bytes).decode('ascii')

print(f"Private key (hex): {private_hex}")
print(f"Public key (hex): {public_hex}")
```

3. **store the generated credentials in a save place**

```bash
[user] vsc > python3 generate_acc.py
Private key (hex): 02df181c21ef23cca914835e990dffee7ba553a3a8f012d0c493621423e36ab7
Public key (hex): 96a70572868db45828374330e203f8df9fce69aa8456bacf17b06821111daaf9
```
Take a look at [the repository here](https://github.com/vsc-eco/wallet-generator).
4 changes: 2 additions & 2 deletions docs/tutorials/first-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ If you are also using NodeJS for other projects, that require a different NodeJS

### IPFS

You need IPFS to be able to inject data into the VSC network.
You need IPFS to be able to ingest data into the VSC network.

For a user friendly desktop application you can use `IPFS Desktop`. It is available for windows/ mac/ ubuntu [here](https://docs.ipfs.tech/install/ipfs-desktop/#install-instructions).

Expand All @@ -26,7 +26,7 @@ You need to install Git to clone the template repository. Refer to the [official

### Hive account

A Hive account is required to inject the contract into the VSC network, if you dont have one already please visit [signup.hive.io](https://signup.hive.io).
A Hive account is required to deploy the contract to the VSC network, if you dont have one already please visit [signup.hive.io](https://signup.hive.io).

### Environment setup

Expand Down

0 comments on commit 7862304

Please sign in to comment.