-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
135 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
--- | ||
layout: default | ||
title: Contracts | ||
nav_order: 3 | ||
nav_order: 4 | ||
has_children: true | ||
permalink: docs/contracts | ||
--- | ||
|
||
# Contracts | ||
|
||
We have a few deployable contracts, right now all geared towards chainlink functionality. The hope is to allow anyone to | ||
deploy their contracts and interact with them using the framework, but that presents some serioud difficulties we're | ||
deploy their contracts and interact with them using the framework, but that presents some serious difficulties we're | ||
currently trying to work through. Until then, we have a few contracts ready to be deployed. | ||
|
||
New to smart contracts? Learn more [here](https://docs.chain.link/docs/beginners-tutorial/)! | ||
New to smart contracts? Learn more [here](https://docs.chain.link/docs/beginners-tutorial/)! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,30 @@ | ||
--- | ||
layout: default | ||
title: Networks | ||
nav_order: 2 | ||
nav_order: 3 | ||
has_children: true | ||
permalink: docs/networks | ||
--- | ||
|
||
# Networks | ||
|
||
Most of the time we run our tests on `ethereum_geth`, a simulated ethereum chain that makes our tests fast and cheap. | ||
But some tests you'll want to run on other simulated chains, or even live test nets. | ||
But some tests you'll want to run on other simulated chains, or even live test nets. You can see an extensive amount of | ||
pre-configured networks defined in our [config.yml](../../config.yml) file. You can add more by adding to that list, | ||
adjusting config values as necessary. | ||
|
||
## Config Values | ||
|
||
| Config Value | Type | Description | | ||
|------------------------|--------|-------------| | ||
| name | string | Human-readable name of the network | ||
| chain_id | int | Chain ID number | ||
| type | string | The type of chain, right now we only really have `evm` at the moment, but are expanding | ||
| secret_private_keys | bool | Whether to look for private keys in you Kubernetes deployment or not. Default to false | ||
| namespace_for_secret | string | Which namespace to look for private keys in, probably `default` | ||
| private_keys | list | List of private keys to use as wallets for tests. Usually the defaults for simulated chains. | ||
| transaction_limit | int | A limit on how much gas to use in a transaction | ||
| transaction_timeout | time | How long to wait before timing out on a transaction. | ||
| minimum_confirmations | int | How many block confirmations to wait before declaring a transaction as successful. | ||
| gas_estimation_buffer | int | A buffer to add to gas estimations if you want to ensure transactions going through | ||
| block_gas_limit | int | The gas limit per-block for the network |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
layout: default | ||
title: Parallel Transactions | ||
nav_order: 5 | ||
nav_order: 6 | ||
has_children: false | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
layout: default | ||
title: Suite Setup | ||
nav_order: 1 | ||
parent: Usage | ||
--- | ||
|
||
The `SuiteSetup` interface provides a lot of convenient ways to setup and interact with your tests, and you should | ||
probably be using it for most, if not all of your test scenarios. | ||
|
||
```go | ||
suiteSetup, err = actions.SingleNetworkSetup( // Indicating we only want to deal with a single blockchain network | ||
environment.NewChainlinkCluster(0), // We're launching 0 chainlink nodes in this example | ||
hooks.EVMNetworkFromConfigHook, // Default, gets network settings | ||
hooks.EthereumDeployerHook, // Default, creates a contract deployer for the network | ||
hooks.EthereumClientHook, // Default, establishes client connection to the network | ||
utils.ProjectRoot, // Default, the path of our config file. | ||
) | ||
Expect(err).ShouldNot(HaveOccurred()) // Make sure no errors happened | ||
``` | ||
|
||
The `SuiteSetup` does a lot of work for us, allowing us to specify how many chainlink nodes we want to deploy, | ||
and where to look for our config file (if we have one). There will be quite a few calls creating `SuiteSetup`s in our | ||
examples. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
layout: default | ||
title: Tear Down | ||
nav_order: 99 | ||
parent: Usage | ||
--- | ||
|
||
## Environments | ||
|
||
By default, the `TearDown()` method deletes the environment that was launched by the `SuiteSetup`. Sometimes that's not | ||
desired though, like when debugging failing tests. For that, there's a handy ENV variable, `KEEP_ENVIRONMENTS`. | ||
|
||
```sh | ||
KEEP_ENVIRONMENTS = Never # Options: Always, OnFail, Never | ||
``` | ||
|
||
## Logs | ||
|
||
`TearDown()` also checks if the test has failed. If so, it builds a `logs/` directory, and dumps the logs and contents | ||
of each piece of the environment that was launched. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
layout: default | ||
title: Usage | ||
nav_order: 2 | ||
has_children: true | ||
permalink: docs/usage | ||
--- | ||
|
||
## Ginkgo and Gomega | ||
|
||
We've been using [Ginkgo](https://github.com/onsi/ginkgo), a BDD testing framework for Go that we've found handy | ||
for organizing and running tests. You should be able to use any other testing framework you like, including Go's built-in | ||
`testing` package, but the examples you find here will be in Ginkgo and its accompanying assertions library, | ||
[Gomega](https://onsi.github.io/gomega/). Both of which are easily human readable however (part of why we like it) and | ||
shouldn't hurt your understanding of the framework at all. |